/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.stream.IntStream;
import java.util.stream.Stream;

/**
 * <p>Project: javase - Stream5
 * <p>Powered by webrx On 2021-12-22 17:54:11
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Stream8 {
    public static void main(String[] args) {
        var ss = Stream.of(1, 2, 3, 4, 5);
        //var sum = ss.reduce(Integer::sum).get();
        //System.out.println(sum);

        //var j = ss.reduce((a, b) -> a * b).get();
        //System.out.println(j);

        var ii = IntStream.rangeClosed(1, 5);
        System.out.println(ii.sum());

    }
}
